﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsolidationTool.Common.Entities
{
    [Serializable]
    public class Entity
    {
        public Entity()
        {
            Groups = new List<Microsoft.SharePoint.SPGroup>();
        }
        public int ID { get; set; }
        public string entityName { get; set; }
        public string EntityFullName { get; set; }
        public string CoCd { get; set; }
        public string Currency { get; set; }
        public string groupName { get; set; }
        public string subRegionName { get; set; }

        public string Tonnage { get; set; }

        public bool ContainsCurrentUser
        {
            get
            {
                for (int i = 0; i < Groups.Count; i++)
                {
                    if (Groups[i].ContainsCurrentUser)
                        return true;
                }

                return false;
            }
        }
        public List<Microsoft.SharePoint.SPGroup> Groups { get; set; }

        public string RegionName { get; set; }

        public Microsoft.SharePoint.SPGroup SubRegionGroup { get; set; }

        public Microsoft.SharePoint.SPGroup Region { get; set; }
    }
}
